<?php require_once ADMINVIEWPATH.'admin_header.php'; ?>
<?php require_once ADMINVIEWPATH.'admin_menu.php'; ?>
<link id="beyond-link" href="<?= STATICURL; ?>css/beyond.min.css" rel="stylesheet" type="text/css" />
    <div class="page-content">
        <div class="page-breadcrumbs">
            <ul class="breadcrumb">
                <li>
                    <i class="fa fa-home"></i>
                    <a href="#">首页</a>
                </li>
                <li class="">
                    <a href="#">资料</a>
                </li>
            </ul>
        </div>
        <div class="page-body">
            <div class="row">
                <div class="col-lg-12 chart-container">
                    <div id="dashboard-chart-visits" class="chart chart-lg no-margin">
                        <div class="widget-body">
                                <table class="table table-striped table-bordered table-hover" id="simpledatatable">
                                    <tbody>
                                        <tr class="gradeX ">
                                            <td class="center">
                                                <form action="/luckydog/video/uploadMessage" method="post" enctype="multipart/form-data"  id="docForm">
                                                    <div class="row">
                                                        <div class="col-md-6">
                                                            <input type="text" name="title"  placeholder="标题" class="form-control" value="<?=$videoInfo['title']?>">
                                                            <div class="horizontal-space"></div>
                                                        </div>
                                                        <div class="col-md-6">
                                                            <select class="documentCat" name="departmentid">
                                                                <option value="0">-----顶级分类----</option>
                                                                <?php foreach($video_cat_list as $k=>$v):?>   
                                                                    <option <?php if($videoInfo['departmentid'] == $v['id']):?>selected="selected"<?php endif;?>  value="<?=$v['id']?>"><?=$v['name']?></option>
                                                                <?php endforeach;?>
                                                            </select>
                                                        </div>
                                                    </div>
                                                    <div>
                                                        <div class="recent-posts" style="float: left">
                                                            <li class="cp_photo_con" style="list-style-type:none;">
                                                                <p ><span  id="J_morepic_upload"></span></p>
                                                            </li>
                                                        </div>
                                                        <div class="widget-content" style="float: right">
                                                            <ul class="thumbnails picList">
                                                            <?php if($videoInfo['banner_img']):?>
                                                                    <li style="list-style-type:none;">
                                                                        <input type="hidden" name="imgurl" value="<?=$videoInfo['banner_img']?>">
                                                                        <a> <img class="imgurl" src="<?= UPLOADURL.$videoInfo['banner_img'] ?>" d-original="<?=$videoInfo['banner_img']?>" width="170" height="100" alt="" > </a>
                                                                    </li>
                                                            <?php endif?>
                                                            </ul>
                                                        </div>
                                                    </div>
                                                    <div style="clear: both;">
                                                        <?php if($videoInfo):?>
                                                            上传文档：<?=$videoInfo['fileName']?>
                                                        <?php else:?>
                                                        <input type="file" multiple="multiple" name="Filedata"  />
                                                        <?php endif;?>
                                                        <br />

                                                        <input type="submit"  style="display: none;"/>
                                                        <input type="hidden" name="documentid"  value="<?=$id?>"/>
                                                        <span id="J_submitForm" class="btn btn-default">提交</span>
                                                    </div>
                                                </form>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                    </div>
                </div>
            </div>
        </div>
<?php require_once ADMINVIEWPATH.'admin_footer.php'; ?>
<script src="<?php echo STATICURL; ?>js/swfupload.js"></script>
<script src="<?php echo STATICURL; ?>js/swfupload.queue.js"></script>
<script src="<?php echo STATICURL; ?>js/fileprogress.js"></script>
<script src="<?php echo STATICURL; ?>js/handlers.js"></script>
<script>
 $("#J_submitForm").click(function(){
        var title = $("input[name='title']").val();
        var departmentid = $(".departmentid").find("option:selected").val();
        if(title == ""){
            layer.msg("标题不能为空！");
            return false;
        }
        if(departmentid == 0){
            layer.msg("请选择文档分类！");
            return false;
        }
        $("#docForm").submit();
    });

      $(function(){
        var settings = {
            flash_url : "<?php echo STATICURL; ?>js/swfupload.swf",
            upload_url: "<?=BASEURL?>luckydog/video/upload_cover",
            file_size_limit : "100 MB",
            file_types : "*.jpg;*.gif;*.jpeg;*.png;",
            file_upload_limit : 100,
            file_queue_limit : 100,
            custom_settings : {
                progressTarget : "fsUploadProgress",
                cancelButtonId : "btnCancel"
            },
            debug : false,
            // Button settings
            button_width : "114",
            button_height : "32",
            button_placeholder_id : "J_morepic_upload",
            button_text_style : ".theFont { font-size: 16;}",
            button_cursor:-2,
            button_window_mode:"TRANSPARENT",
            button_action:-100,//-110多图片上传，-100但图片上传，-120文件上传
            button_image_url : "<?php echo STATICURL; ?>img/banner_upload_place.png",

            file_queued_handler : fileQueued,
            file_queue_error_handler : fileQueueError,
            file_dialog_complete_handler : fileDialogComplete,
            upload_start_handler : banner_uploadStart,
            upload_progress_handler : uploadProgress,
            upload_error_handler : uploadError,
            upload_success_handler : banner_upload_Success,
            upload_complete_handler : uploadComplete
        };
        swfu = new SWFUpload(settings);
    }())

  
</script>


